import 'package:flutter/material.dart';
import 'package:flutter/src/widgets/framework.dart';
import 'package:flutter_app/BaseMaterialStateWidget.dart';

import 'ImageDetailPage.dart';

class AnimationDemo extends BaseMaterialStateWidget {
  int num = 0;

  @override
  Widget buildContent(BuildContext context) {
    return ListView(
      children: <Widget>[
//        AnimatedOpacity(
//            opacity: num % 2 == 0 ? 1.0 : 0.0,
//            duration: Duration(milliseconds: 1000),
//            child: Container(
//              width: 300,
//              height: 300,
//              color: Colors.green,
//            )),
//        RaisedButton(
//          onPressed: () {
//            setState(() {
//              num++;
//            });
//          },
//          child: Text('CLICK'),
//        ),
        GestureDetector(
          child: Hero(tag: '第一张图片', child: Image.network('https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1568871119884&di=2cb5da78533c90ce780dc83267c0c40d&imgtype=0&src=http%3A%2F%2Fphotocdn.sohu.com%2F20131105%2FImg389566097.jpg')),
          onTap: (){
            Navigator.push(context, MaterialPageRoute(builder: (_){
              return ImageDetailPage();
            }));
          },
        )
      ],
    );
  }

  @override
  String getTitle() {
    return "动画";
  }
}
